package net.ankao.org.easylock.utils;

import org.springframework.cache.Cache;

import java.lang.reflect.Method;
import java.util.Collection;

/**
 * <p>
 * ExpressionRootObject
 * </p>
 *
 * @author ankao.net
 * @since 2022/3/28
 */
public class ExpressionRootObject {

    /**
     * 有效的缓存集合
     */
    private Collection<? extends Cache> caches;
    /**
     * 目标方法
     */
    private Method method;
    /**
     * 目标方法名
     */
    private String methodName;
    /**
     * 方法参数
     */
    private Object[] args;
    /**
     * 目标对象
     */
    private Object target;
    /**
     * 目标对象 Class 类型
     */
    private Class<?> targetClass;


    public ExpressionRootObject() {
    }

    public ExpressionRootObject(Method method, String methodName, Object[] args, Object target, Class<?> targetClass) {
        this.method = method;
        this.methodName = methodName;
        this.args = args;
        this.target = target;
        this.targetClass = targetClass;
    }

    public Collection<? extends Cache> getCaches() {
        return caches;
    }

    public void setCaches(Collection<? extends Cache> caches) {
        this.caches = caches;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    public Object getTarget() {
        return target;
    }

    public void setTarget(Object target) {
        this.target = target;
    }

    public Class<?> getTargetClass() {
        return targetClass;
    }

    public void setTargetClass(Class<?> targetClass) {
        this.targetClass = targetClass;
    }
}
